package com.xiong.miaosha.controller;

import com.xiong.miaosha.rabbitmq.MQReceiver;
import com.xiong.miaosha.rabbitmq.MQSender;
import com.xiong.miaosha.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wardseptember
 * @create 2020-03-22 10:53
 */
@Controller
@RequestMapping("/MQ")
public class testController {
    @Autowired
    MQSender mqSender;

    @Autowired
    MQReceiver mqReceiver;

    @RequestMapping("/mq")
    @ResponseBody
    public Result<String> mq() {
        String msg = "hello world";
        mqSender.sender(msg);
        return Result.success(msg);
    }

}
